package org.micro.frame.um.api;

import org.micro.frame.um.entity.Member;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * The Feign Client API
 *
 * @author lry
 */
@FeignClient(value = "micro-frame-um-provider")
public interface MemberFeignApi {

    @RequestMapping(value = "member/{id}", method = RequestMethod.GET)
    Member findMemberById(@PathVariable("id") Long id);

    @RequestMapping(value = "members", method = RequestMethod.GET)
    List<Member> findAll();

    @RequestMapping(value = "addMember", method = RequestMethod.POST)
    Integer addMember(@RequestBody Member member);

}